// import { createRouter, createWebHashHistory } from 'vue-router'
// import Home from '../components/Home.vue'

// const routes = [
//     {
//         name: 'home',
//         path: '/',
//         meta: { title:'首页' },
//         component: Home,
//         redirect:'/welcome',
//         children: [
//             {
//                 name: 'welcome',
//                 path: '/welcome',
//                 meta: { title:'欢迎体验Vue3项目' },
//                 component:() => import('./../views/Welcome.vue')
//             },
//             {
//                 name: 'profile',
//                 path: '/profile',
//                 meta: { title:'个人信息' },
//                 component:() => import('./../views/general/profile/index.vue')
//             },
//             {
//                 name: 'database',
//                 path: '/database',
//                 meta: { title:'数据库管理' },
//                 component:() => import('./../views/general/database/index.vue'),
//                 children: [
//                     {  
//                         name: 'getbackuplstList',
//                         path: '/getbackuplstList',
//                         meta: {
//                             title: '备份列表'
//                         },
//                         component: () => import('./../views/general/database/getbackuplstList.vue')
//                     },
                     
//                 ]
//             },
//             {
//                 name: 'config',
//                 path: '/config',
//                 meta: { title:'系统配置' },
//                 component:() => import('./../views/general/configset/index.vue')
//             },
            
           
//             {
//                 name: 'admin',
//                 path: '/admin',
//                 meta: {
//                     title: '管理员管理'
//                 },
//                 component: () => import('./../views/auth/admin/index.vue'),
//                 children: [
//                     {  
//                         name: 'add',
//                         path: '/add',
//                         meta: {
//                             title: '管理员管理'
//                         },
//                         component: () => import('./../views/auth/admin/add.vue')
//                     },
//                     {  
//                         name: 'edit',
//                         path: '/edit',
//                         meta: {
//                             title: '管理员管理'
//                         },
//                         component: () => import('./../views/auth/admin/edit.vue')
//                     },
//                 ]
//             },
//             {
//                 name: 'group',
//                 path: '/group',
//                 meta: {
//                     title: '角色管理'
//                 },
//                 component: () => import('./../views/auth/group/index.vue'),
//                 // children: [
//                 //     {  
//                 //         name: 'add',
//                 //         path: '/groupadd',
//                 //         meta: {
//                 //             title: '角色管理1'
//                 //         },
//                 //         component: () => import('./../views/auth/group/add.vue')
//                 //     } 
//                 // ]
//             },
//             {
//                 name: 'rule',
//                 path: '/rule',
//                 meta: {
//                     title: '菜单管理'
//                 },
//                 component: () => import('./../views/auth/rule/index.vue'),
//                 children: [
//                     {  
//                         name: 'add',
//                         path: '/rule/add',
//                         meta: {
//                             title: '菜单管理'
//                         },
//                         component: () => import('./../views/auth/rule/add.vue')
//                     },
//                     {  
//                         name: 'edit',
//                         path: '/rule/edit',
//                         meta: {
//                             title: '菜单管理'
//                         },
//                         component: () => import('./../views/auth/rule/edit.vue')
//                     },
//                 ]
//             },
             
            
//             {
//                 name: 'adminlog',
//                 path: '/adminlog',
//                 meta: {
//                     title: '日志管理'
//                 },
//                 component: () => import('./../views/auth/adminlog/index.vue')
//             },
//             {
//                 name: 'addon',
//                 path: '/addon',
//                 meta: {
//                     title: '插件管理'
//                 },
//                 component: () => import('./../views/addon/index.vue'),
//                 children: [
//                     {  
//                         name: 'add',
//                         path: '/addon/add', 
//                         meta: {
//                             title: '菜单管理'
//                         },
//                         component: () => import('./../views/addon/add.vue')
//                     }
                     
//                 ]
//             },
//         ]
//     },
//     {
//         name: 'login',
//         path: '/login',
//         meta: { title:'登陆' },
//         component:() => import('./../views/Login.vue')
//     },
// ]

// const router = createRouter({
//     history: createWebHashHistory(),
//     routes
// })
// export default router
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../components/Home.vue'

const routes = [
    {
        name: 'home',
        path: '/',
        meta: { title:'首页' },
        component: Home,
        redirect:'/welcome',
        children: [
            {
                name: 'welcome',
                path: '/welcome',
                meta: { title:'欢迎体验Vue3项目' },
                component:() => import('./../views/Welcome.vue')
            },
            {
                name: 'profile',
                path: '/profile',
                meta: { title:'个人信息' },
                component:() => import('./../views/general/profile/index.vue')
            },
            {
                name: 'database',
                path: '/database',
                meta: { title:'数据库管理' },
                component:() => import('./../views/general/database/index.vue'),
                children: [
                    {  
                        name: 'getbackuplstList',
                        path: '/getbackuplstList',
                        meta: {
                            title: '管理员管理'
                        },
                        component: () => import('./../views/general/database/getbackuplstList.vue')
                    },
                     
                ]
            },
            {
                name: 'config',
                path: '/config',
                meta: { title:'系统配置' },
                component:() => import('./../views/general/configset/index.vue')
            },
            
           
            {
                name: 'admin',
                path: '/admin',
                meta: {
                    title: '管理员管理'
                },
                component: () => import('./../views/auth/admin/index.vue'),
                children: [
                    {  
                        name: 'admin/add',
                        path: '/admin/add',
                        meta: {
                            title: '管理员管理'
                        },
                        component: () => import('./../views/auth/admin/add.vue')
                    },
                    {  
                        name: 'admin/edit',
                        path: '/admin/edit',
                        meta: {
                            title: '管理员管理'
                        },
                        component: () => import('./../views/auth/admin/edit.vue')
                    },
                ]
            },
            {
                name: 'group',
                path: '/group',
                meta: {
                    title: '角色管理'
                },
                component: () => import('./../views/auth/group/index.vue'),
                children: [
                    {  
                        name: 'group/add',
                        path: '/group/add',
                        meta: {
                            title: '角色管理'
                        },
                        component: () => import('./../views/auth/group/add.vue')
                    },
                    {  
                        name: 'group/edit',
                        path: '/group/edit',
                        meta: {
                            title: '角色管理'
                        },
                        component: () => import('./../views/auth/group/edit.vue')
                    },
                ]
            },
            {
                name: 'rule',
                path: '/rule',
                meta: {
                    title: '菜单管理'
                },
                component: () => import('./../views/auth/rule/index.vue'),
                children: [
                    {  
                        name: 'ruleadd',
                        path: '/rule/add',
                        meta: {
                            title: '菜单管理'
                        },
                        component: () => import('./../views/auth/rule/add.vue')
                    },
                    {  
                        name: 'ruleedit',
                        path: '/rule/edit',
                        meta: {
                            title: '菜单管理'
                        },
                        component: () => import('./../views/auth/rule/edit.vue')
                    },
                ]
            },
             
            {
                name: 'dome',
                path: '/dome',
                meta: {
                    title: 'dome'
                },
                component: () => import('./../views/dome/index.vue'),
                children: [
                  
                    {  
                        name: 'domeedit',
                        path: '/dome/edit',
                        meta: {
                            title: 'dome'
                        },
                        component: () => import('./../views/dome/edit.vue')
                    },
                ]
            },
            {  
                name: 'domeadd',
                path: '/dome/add',
                meta: {
                    title: 'dome'
                },
                component: () => import('./../views/dome/add.vue')
            },
             
            
            {
                name: 'adminlog',
                path: '/adminlog',
                meta: {
                    title: '日志管理'
                },
                component: () => import('./../views/auth/adminlog/index.vue')
            },
            {
                name: 'addon',
                path: '/addon',
                meta: {
                    title: '插件管理'
                },
                component: () => import('./../views/addon/index.vue')
            },
        ]
    },
    {
        name: 'login',
        path: '/login',
        meta: { title:'登陆' },
        component:() => import('./../views/Login.vue')
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})
export default router